import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
@Injectable({
    providedIn: 'root'
})
export class ApiRead {

    constructor(private httpClient:HttpClient) {
    }
    public getJSON(url: string) : Observable<any> {
        console.log('--------------------------------');
        return Observable.create(observer => {
            this.httpClient.get(url).subscribe(res=>{
                observer.next(res)
              },err=>{
                observer.error(err)  
              })
        })
    }
  
    
}
